import java.util.Scanner;

public class MultiplyArrayNumbers {
	public static void main(String args[]) {

		int firstMultiplier;
		int secondMultiplier;
		byte numberArray[] = new byte[100];
		byte multipleResult[] = new byte[100];
		Scanner in = new Scanner(System.in);

		// input 2 numbers from the console that you want to multiply
		firstMultiplier = in.nextInt();
		secondMultiplier = in.nextInt();

		// calculate size of the first and second multiplier value
		byte firstMultiplierSize = (byte) (firstMultiplier + "").length();
		byte secondMultiplierSize = (byte) (secondMultiplier + "").length();

		// Store firstMultiplier value in the Byte type array
		for (byte i = (byte) (numberArray.length - 1); i >= 0
				&& firstMultiplier > 0; i--, firstMultiplier /= 10) {
			numberArray[i] = (byte) (firstMultiplier % 10);
		}

		int moduloNumber;

		// Multiply the integers present in numberArrray with secondMultiplier's
		// every single digit starting at one's place digit
		// value and store its result in the multipleResult array
		for (byte i = 0; i <= secondMultiplierSize && secondMultiplier > 0; secondMultiplier /= 10, i++) {
			byte k = (byte) (multipleResult.length - 1 - i);
			moduloNumber = secondMultiplier % 10;
			for (byte j = (byte) (numberArray.length - 1); j >= (numberArray.length - firstMultiplierSize); j--) {
				// multiply every digit of secondMultiplier with the
				// firstMultiplier
				byte multiplyRes = (byte) (numberArray[j] * moduloNumber);
				while (k >= 0) {
					// if multiplication results into a number > 9
					if (multiplyRes > 9) {
						// store the ten's place digit of multiplyRes in the
						// array
						multipleResult[k - 1] = (byte) ((multipleResult[k - 1] + (multiplyRes / 10)));
						// check if storing the addition result at (k - 1)th
						// position in the array is > 9
						if (multipleResult[k - 1] > 9) {
							// multipleResult[k - 2] = (byte) (multipleResult[k
							// - 2] + (multipleResult[k - 1] / 10));
							multipleResult[k - 2] += (multipleResult[k - 1] / 10);
							multipleResult[k - 1] = (byte) (multipleResult[k - 1] % 10);
						}
					}
					// multipleResult[k] = (byte) (multipleResult[k] +
					// (multiplyRes % 10));
					// if multiplication result <= 9
					multipleResult[k] += (multiplyRes % 10);
					// storing the value at Kth position in an array results
					// into a number > 9
					if (multipleResult[k] > 9) {
						multipleResult[k - 1] = (byte) (multipleResult[k - 1] + (multipleResult[k] / 10));
						multipleResult[k] = (byte) (multipleResult[k] % 10);
					}
					k--;
					break;
				}

			}
		}

		// truncate all the zero's until non-zero number appear in the
		// multipleResult array
		int i;
		String number = "";
		for (i = 0; i < multipleResult.length && multipleResult[i] == 0; i++)
			;

		for (; i < multipleResult.length; i++) {

			number += multipleResult[i];

			System.out.print(multipleResult[i]);
		}
		System.out.println("");
		System.out.println(number);

	}
}
